package com;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
import org.springframework.context.annotation.Configuration;


/**
 * @author lizhenxing
 */
@Slf4j
@Configuration
public class WebApplicationContextConfig implements  WebServerFactoryCustomizer<ConfigurableServletWebServerFactory> {

    @Override
    public void customize(ConfigurableServletWebServerFactory server) {
        TomcatServletWebServerFactory tomcatServer = (TomcatServletWebServerFactory) server;
        tomcatServer.setPort(8082);
    }

}
